<?php $this->load->view('header'); echo $link; ?>

<h1>Simple Ajax Demos</h1>

<p><strong>form_remote_tag</strong> - Ajax form submission.</p>
<p><?=$this->pquery->form_remote_tag(array('url'=>$controller_url.'ajax/','update'=>'#idtoupdate','type'=>'POST'));?>
Field : <input type="text" name="field" /><br />
<input type="submit" /> 
</form>
</p>
<p>
<div id="idtoupdate">Update ME(Ajax form)</div>
</p>

<hr />
<p><strong>link_to_remote</strong> - Ajax through a Link.</p>
<p><?=$this->pquery->link_to_remote("Ajax Link",array('url'=>$controller_url.'ajaxlink/','update'=>'#idtoupdate1'));?>
</p>
<p>
<div id="idtoupdate1">Update ME(Ajax Link)</div>
</p>

<hr />
<p><strong>link_to_remote</strong> - Ajax through a Link ( with callbacks ).</p>
<p><?=$this->pquery->link_to_remote("Ajax Link",array('url'=>$controller_url.'ajaxlinkc/','update'=>'#idtoupdate2','success'=>'alert("Ajax was successful");'));?>
</p>
<p>
<div id="idtoupdate2">Update ME(Ajax Link w callaback)</div>
</p>

<hr />
<!-- new Date().getTime() for ie caching problem ;
<p><strong>periodically_call_remote</strong> - Update a from peridically ( keep session alive ).</p>
<script type="text/javascript">
 $(document).ready(function() {
 	 <?=$this->pquery->periodically_call_remote(array('url'=>$controller_url.'ajaxtime/"+new Date().getTime()+"','update'=>'#idtime','frequency'=>1));?> 	
  });
</script> -->
<p>
<div id="idtime">Ajax Time</div>
</p>
<?php
$this->load->view('footer');
?>